<template>
    <div class="sourceApiSum" v-loading="loading">
        <plainTable :tableData="tableDataDisplay" :tableConfigData="tableConfigData" @changeStar="onClickChangeStar" :pageInfo="pageInfo"   @prevPage="prevPage" @nextPage="nextPage"/>
        <editStarPopup ref="editStarPopupRef"/>
    </div>
</template>

<script setup>
import plainTable from '@/components/plainTable.vue'
import editStarPopup from '@/components/editStarPopup.vue' 
import { ref } from 'vue'
import { useSourceApiSum } from '@/hooks/index'
import { reqModifyLevel } from '@/api/index'
import { useUserStore } from "@/store/index";

const { initData,prevPage, nextPage, pageInfo,loading,tableDataDisplay, tableConfigData } = useSourceApiSum();
const editStarPopupRef = ref(null);
const userStore = useUserStore();

const onClickChangeStar = (row) => {
    clog("行数据：",row);
    editStarPopupRef.value.showDialog({
        ouser_id: userStore.ouser_id,
        cid: row.cid || '0',
        bid: row.bid || '0',
        level: row.level,
    },reqModifyLevel, () => {
        initData();
    });
}

// const onClickControlUse = (row) => {
//     clog("行数据：",row);
//     updateStatus(row);
// }
</script>
<style scoped lang="scss">
.sourceApiSum {
}
</style>